﻿<!--
    razor是mvc默认的视图引擎

-->
@{
    Layout = "_Layout";
}
@{
    List<Student1> list = new()
    {
        new Student1(1,"余冰",34),
        new Student1(2,"老赵",35),
        new Student1(3,"老刘",35)
    };
}

 <table>
     <thead>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>年龄</th>
        </tr>
     </thead>
    <tbody>
        @foreach (var item in list)
        {
         <tr>
                <td>@item.Id</td>
                <td>@item.Name</td>
                <td>@item.Age</td>
         </tr>   
        }
    </tbody>

 </table>